import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("idx_title", ["title"], {})
@Index("idx_type", ["type"], {})
@Entity("rrz_tag", { schema: "rrzcms" })
export class RrzTag {
  @PrimaryGeneratedColumn({
    type: "int",
    name: "id",
    comment: "标签ID",
    unsigned: true,
  })
  id: number;

  @Column("varchar", { name: "title", comment: "标签标题", length: 50 })
  title: string;

  @Column("tinyint", {
    name: "type",
    comment: "标签类型（1：文章，2：产品）",
    unsigned: true,
    default: () => "'1'",
  })
  type: number;

  @Column("varchar", { name: "fgcolor", comment: "标签字体颜色", length: 7 })
  fgcolor: string;

  @Column("varchar", { name: "bgcolor", comment: "标签背景颜色", length: 7 })
  bgcolor: string;

  @Column("varchar", {
    name: "seo_title",
    nullable: true,
    comment: "SEO标题",
    length: 200,
  })
  seoTitle: string | null;

  @Column("varchar", {
    name: "seo_keywords",
    nullable: true,
    comment: "SEO关键词",
    length: 200,
  })
  seoKeywords: string | null;

  @Column("text", {
    name: "seo_description",
    nullable: true,
    comment: "SEO描述",
  })
  seoDescription: string | null;

  @Column("tinyint", {
    name: "is_common",
    nullable: true,
    comment: "是否常用标签，0=否，1=是",
    width: 1,
    default: () => "'0'",
  })
  isCommon: boolean | null;

  @Column("int", {
    name: "view_count",
    nullable: true,
    comment: "点击",
    unsigned: true,
    default: () => "'0'",
  })
  viewCount: number | null;

  @Column("int", {
    name: "total",
    nullable: true,
    comment: "文档数",
    unsigned: true,
    default: () => "'0'",
  })
  total: number | null;

  @Column("int", {
    name: "weekcc",
    nullable: true,
    comment: "周统计",
    unsigned: true,
    default: () => "'0'",
  })
  weekcc: number | null;

  @Column("int", {
    name: "monthcc",
    nullable: true,
    comment: "月统计",
    unsigned: true,
    default: () => "'0'",
  })
  monthcc: number | null;

  @Column("int", {
    name: "weekup",
    nullable: true,
    comment: "每周更新",
    unsigned: true,
    default: () => "'0'",
  })
  weekup: number | null;

  @Column("int", {
    name: "monthup",
    nullable: true,
    comment: "每月更新",
    unsigned: true,
    default: () => "'0'",
  })
  monthup: number | null;

  @Column("varchar", {
    name: "tmpl_path",
    nullable: true,
    comment: "模板",
    length: 100,
  })
  tmplPath: string | null;

  @Column("int", {
    name: "add_time",
    comment: "添加时间",
    unsigned: true,
    default: () => "'0'",
  })
  addTime: number;
}
